Skip to content

Guard Firebase Crashlytics calls against GMS cold-start crash on boot#7

Merged
chamika merged 6 commits intomainfrom
copilot/fix-app-launch-delay
Mar 22, 2026
Merged

Guard Firebase Crashlytics calls against GMS cold-start crash on boot#7
chamika merged 6 commits intomainfrom
copilot/fix-app-launch-delay

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 22, 2026

  • Add safeLog(message), safeSetCustomKey(key, String), safeSetCustomKey(key, Int), safeSetCustomKey(key, Boolean) to FirebaseUtils.kt
  • Refactor DashTuneMusicService.kt — replace all .log() and .setCustomKey() calls; remove FirebaseCrashlytics import
  • Refactor DashTuneSessionCallback.kt — replace all .log() and .setCustomKey() calls; remove FirebaseCrashlytics import
  • Refactor SignInViewModel.kt — replace all .log() and .setCustomKey() calls; remove FirebaseCrashlytics import
  • Refactor AlbumArtContentProvider.kt — replace .setCustomKey() + .recordException() calls; add FirebaseUtils import; remove FirebaseCrashlytics import
  • Refactor MediaRepository.kt — replace all .log(), .setCustomKey(), .recordException() calls; add FirebaseUtils import; remove FirebaseCrashlytics import

💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

…ls for recordException

Co-authored-by: chamika <754909+chamika@users.noreply.github.com>
Agent-Logs-Url: https://github.com/chamika/DashTune/sessions/e8ccf17a-f1b2-48c9-bbd2-94b33498c1e7
@chamika
Copy link
Copy Markdown
Owner

chamika commented Mar 22, 2026

@copilot review this MR

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 22, 2026

@copilot review this MR

Here's the review of the PR:

Overall: ✅ Changes are correct and well-structured. The core goal — guarding every Crashlytics call against a GMS cold-start crash — is fully achieved.


FirebaseUtils.kt

  • All 5 wrappers (safeRecordException, safeLog, safeSetCustomKey ×3) follow a consistent try/catch pattern with a Log.w fallback. ✅
  • FirebaseCrashlytics import is now exclusively here — no other file needs it. ✅
  • Calling getInstance() on every invocation (rather than caching it) is intentional and correct: GMS availability can change across the lifetime of the service, so a fresh lookup ensures the guard is always meaningful. ✅

Call-site changes (5 files)

  • DashTuneMusicService, DashTuneSessionCallback, SignInViewModel, AlbumArtContentProvider, MediaRepository: all direct .log(), .setCustomKey(), and .recordException() calls replaced; FirebaseCrashlytics import removed in each. ✅
  • The separate compilation-fix commit (aaa2f8a) correctly removes the redundant FirebaseUtils import from AlbumArtContentProvider (same package — no import needed) and restores the missing OkHttpClient import. ✅

Minor observations (no action needed)

  • safeLog("Sync started") is called both in DashTuneSessionCallback.sync() and MediaRepository.sync(), so a sync will log twice. This is harmless and consistent with the existing verbosity style.
  • The pingServer error-handling in SignInViewModel extracts the URL host via a nested try/catch before recording the exception — a little verbose, but safe and the intent is clear.

No regressions, no unguarded Crashlytics paths remaining. LGTM.

@chamika chamika marked this pull request as ready for review March 22, 2026 10:22
@chamika chamika merged commit e780cb9 into main Mar 22, 2026
1 check failed
@chamika chamika deleted the copilot/fix-app-launch-delay branch March 22, 2026 10:22
Copilot stopped work on behalf of chamika due to an error March 22, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants